﻿using System;
using System.Linq;

namespace _04.CalculateSurfaceOfTriangle
{
    class CalculateSurfaceOfTriangle
    {
        static double CalculateSurfaceBySideAltitude(double side,double altitude )
        {
            double area = (side * altitude) / 2;
            return area;
        }
        static double CalculateSurfaceByThreeSides(double side1, double side2,double side3)
        {
            double p = (side1 + side2 + side3) / 2;
            double area = Math.Sqrt(p*(p-side1)*(p-side2)*(p-side3));
            return area;
        }
        static double CalculateSurfaceBySidesAndAngle(double side1, double side2, double angle)
        {
            angle = Math.PI * angle / 180.0;
            double area = (side1*side2*Math.Sin(angle))/2;
            return area;
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Area is:{0}",CalculateSurfaceBySideAltitude(6,4));
            Console.WriteLine("Area is:{0}", CalculateSurfaceByThreeSides(5, 5, 6));
            Console.WriteLine("Area is:{0}", CalculateSurfaceBySidesAndAngle(6, 5, 30));
        }
    }
}
